home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / SASETUP.MSI / F77712_sitemodify_prop.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  25.0 KB  |  780 lines

  1. <%
  2.     '
  3.     ' Copyright (c) Microsoft Corporation.  All rights reserved. 
  4.     '
  5.     '-------------------------------------------------------------------------
  6.     'Modify Site Property page
  7.     '-------------------------------------------------------------------------
  8.  
  9.     '-------------------------------------------------------------------------
  10.     ' Start  of declaring form variables
  11.     '-------------------------------------------------------------------------
  12.  
  13.     Dim F_strSiteID                    'holds siteidentifier value
  14.     Dim F_strDir                    'holds site directory path    
  15.     Dim F_strAdminName                'holds admin name value
  16.     Dim F_strAdminPswd                'holds admin password
  17.     Dim F_strConfirmPswd            'holds Confirm password value
  18.     Dim F_strPswdChanged            'holds a value whether Admin password is changed
  19.     Dim F_strUserLocation            'holds the location of user
  20.  
  21.     'init the checkbox
  22.     '-------------------------------------------------------------------------
  23.     ' Start of Error content
  24.     '-------------------------------------------------------------------------
  25.     
  26.     '-------------------------------------------------------------------------
  27.     ' End of declaring form variables
  28.     '-------------------------------------------------------------------------    
  29.     %>
  30.     <!-- #include file="inc_wsa.js" -->
  31.     <script language="Javascript">
  32.     
  33.         function GenInit()
  34.         {
  35.             //do all the init
  36.         }
  37.  
  38.         function GenValidatePage()
  39.         {
  40.             //do all the validation and return false if data is invalid            
  41.             // validate site identifier values        
  42.                 
  43.             var strID;
  44.             var strDir;
  45.             var strIndex;
  46.             
  47.             //validate site ID
  48.             strID= document.frmTask.txtSiteID.value;
  49.             if(document.frmTask.txtSiteID.value=="")
  50.             {
  51.                 DisplayErr("<%= Server.HTMLEncode(L_ID_NOTEMPTY_ERROR_MESSAGE)%>");
  52.                 document.frmTask.txtSiteID.focus();
  53.                 return false;
  54.             }        
  55.                         
  56.             if (!(checkKeyforValidCharacters(strID,"id")))
  57.                     return false;
  58.                     
  59.             // validate directory        
  60.             strDir = document.frmTask.txtDir.value;
  61.             
  62.             if(strDir=="")
  63.             {                
  64.                  document.frmTask.onkeypress = ClearErr;    
  65.                  DisplayErr("<%=Server.HTMLEncode(L_DIR_NOTEMPTY_ERROR_MESSAGE)%>");
  66.                  document.frmTask.txtDir.focus();
  67.                  document.frmTask.onkeypress = ClearErr;
  68.                  return false;
  69.             }
  70.  
  71.             if (!(checkKeyforValidCharacters(strDir,"dir")))
  72.                     return false;        
  73.  
  74.             strIndex = strID.indexOf("\\\\");
  75.             if (strIndex > 0)
  76.             {                
  77.                 DisplayErr("<%= Server.HTMLEncode(L_INVALID_DIR_ERRORMESSAGE) %>");
  78.                 document.frmTask.txtDir.focus();
  79.                 return false;
  80.             }                    
  81.             
  82.             // Check whether Admin text is null
  83.             if(document.frmTask.txtSiteAdmin.value == "")
  84.             {
  85.                  DisplayErr("<%=Server.HTMLEncode(L_ADMIN_NOTEMPTY_ERROR_MESSAGE)%>");
  86.                  document.frmTask.txtSiteAdmin.focus();
  87.                  document.frmTask.onkeypress = ClearErr;         
  88.                  return false;
  89.             }
  90.  
  91.             // Check for Admin Password
  92.             if (document.frmTask.txtAdminPwd.value != document.frmTask.txtConfirmPswd.value) 
  93.             {
  94.                 document.frmTask.txtAdminPwd.value="";
  95.                 document.frmTask.txtConfirmPswd.value="";
  96.                 DisplayErr("<%=Server.HTMLEncode(L_PWD_MISMATCH_ERROR_MESSAGE)%>");
  97.                 document.frmTask.txtAdminPwd.focus();
  98.                 return false;
  99.             }
  100.  
  101.             return true;
  102.         }        
  103.         
  104.  
  105.         function GenSetData()
  106.         {            
  107.             
  108.             return true;
  109.         }
  110.  
  111.         
  112.         function PasswordChanged()
  113.         {
  114.             document.frmTask.hdnPswdChanged.value = 1
  115.         }
  116.         
  117.     </script>
  118.     
  119.     <%
  120.  
  121.     '-------------------------------------------------------------------------
  122.     'Function name        :Generalviewtab
  123.     'Description        :Serves in getting the general properties page
  124.     'Input Variables    :None
  125.     'Output Variables    :None
  126.     'Returns            :(True / Flase )
  127.     'Global Variables    :None
  128.     '                in    :L_*            
  129.     '--------------------------------------------------------------------------
  130.  
  131.     Function Generalviewtab()
  132.         On Error Resume Next
  133.         Err.Clear
  134.  
  135.         Call GetDomainRole( G_strDirRoot, G_strSysName )
  136.     %>
  137.  
  138.         <TABLE WIDTH=518 VALIGN=middle ALIGN=left BORDER=0 CELLSPACING=0 CELLPADDING=2 class="TasksBody" >
  139.             <TR>
  140.                 <TD class="TasksBody" nowrap>
  141.                     <%=L_GEN_SITE_ID_TEXT%>
  142.                 </TD>
  143.                 <TD class="TasksBody" colspan = 2>
  144.                     <input type=text class="formField" NAME="txtSiteID"  MAXLENGTH="12" SIZE="30" value="<%=server.HTMLEncode(F_strSiteID)%>" style="background-color:silver" readonly onKeyPress = "GenerateDir(); ClearErr();">
  145.                 </TD>
  146.             </TR>
  147.             <TR>
  148.                 <TD class="TasksBody" >
  149.                     <%=L_GEN_SITE_DIR_TEXT%>
  150.                 </TD>
  151.                 <TD class="TasksBody" >
  152.                     <input type=text class="formField" NAME="txtDir"  SIZE="30"  value="<%=server.HTMLEncode(F_strDir)%>" style="background-color:silver" readonly onKeyPress = "ClearErr();">
  153.                 </TD>
  154.                 <TD class="TasksBody" nowrap style="visibility:hidden">
  155.                     <input type=checkbox class="formField" NAME="chkCreatePath"  checked>
  156.                     <%=L_GEN_SITE_CREATEDIR_TEXT%>
  157.                 </TD>                
  158.             </TR>
  159.             <TR>
  160.                 <TD class="TasksBody" COLSPAN=3><HR></TD>
  161.             </TR>
  162.             <TR>
  163.                 <%If F_strUserLocation = "1" Then%>
  164.                     <TD class="TasksBody" colspan=3>
  165.                         <input type=radio class="formField" id="radAccountLocation" checked value="1">
  166.                         <%=L_LOCAL_USER_ACCOUNT%>
  167.                     </TD>
  168.                 <%Else%>
  169.                     <TD class="TasksBody" colspan=3>
  170.                         <input type=radio class="formField" id="radAccountLocation" value="1" disabled>
  171.                         <%=L_LOCAL_USER_ACCOUNT%>
  172.                     </TD>
  173.  
  174.                 <%End If%>
  175.             </TR>
  176.             <TR>
  177.                 <TD class="TasksBody" nowrap>
  178.                     <%=L_GEN_SITE_ADMIN_TEXT%>
  179.                 </TD>
  180.                 <TD class="TasksBody" colspan = 2>
  181.                     <input type=text class="formField" NAME="txtSiteAdmin" style="background-color:silver" readonly MAXLENGTH="256" SIZE="30"   value="<%=server.HTMLEncode(F_strAdminName)%>"  OnKeypress="checkKeyforCharacters(this)">
  182.                 </TD>
  183.             </TR>
  184.             <TR>
  185.                 <TD class="TasksBody" nowrap>
  186.                     <%'=L_GEN_SITE_ADMIN_PSWD_TEXT%>
  187.                 </TD>
  188.                 <TD class="TasksBody" colspan = 2>
  189.                     <input type=hidden class="formField" NAME="txtAdminPwd" MAXLENGTH="127" SIZE="30" OnChange="PasswordChanged()"  value="<%=server.HTMLEncode(F_strAdminPswd)%>" OnKeypress="ClearErr();" onfocus="this.select();">
  190.                 </TD>
  191.             </TR>
  192.             <TR>
  193.                 <TD class="TasksBody" nowrap>
  194.                     <%'=L_GEN_SITE_CONFIRM_PSWD_TEXT%>
  195.                 </TD>
  196.                 <TD class="TasksBody" colspan = 2>
  197.                     <input type=hidden class="formField" NAME="txtConfirmPswd" MAXLENGTH="127" SIZE="30" OnChange="PasswordChanged()" value="<%=server.HTMLEncode(F_strConfirmPswd)%>" onKeyPress = "ClearErr();" onfocus="this.select();">
  198.                 </TD>
  199.             </TR>
  200.             <TR>
  201.                 <TD class="TasksBody">
  202.                  
  203.                 </TD>
  204.             </TR>
  205.             <TR>
  206.                 <TD class="TasksBody" colspan=3>
  207.                 <% CheckForSecureSite() %>
  208.                 </TD>
  209.             </TR>
  210.  
  211.         </TABLE>
  212.         <input type=hidden name=hdnPswdChanged value = "<%=server.HTMLEncode(F_strPswdChanged)%>">
  213.         <input type=hidden name=hdnUserLocation value = "<%=server.HTMLEncode(F_strUserLocation)%>">
  214.     <%
  215.         
  216.     End Function
  217.  
  218.     '-------------------------------------------------------------------------
  219.     'Function name        :Generalhiddentab
  220.     'Description        :Serves in setting the hidden fields for general properties page
  221.     'Input Variables    :None
  222.     'Output Variables    :None
  223.     'Returns            :(True / Flase )
  224.     'Global Variables    :None
  225.     '                in    :L_*            
  226.     '--------------------------------------------------------------------------
  227.     
  228.     Function Generalhiddentab()    
  229.             
  230.     %>
  231.         <input type=hidden name=txtSiteID value = "<%=server.HTMLEncode(F_strSiteID)%>" >
  232.         <input type=hidden name=txtDir value = "<%=server.HTMLEncode(F_strDir)%>" >
  233.         <input type=hidden name=txtSiteAdmin value = "<%=server.HTMLEncode(F_strAdminName)%>" >
  234.         <input type=hidden name=txtAdminPwd value = "<%=server.HTMLEncode(F_strAdminPswd)%>" >
  235.         <input type=hidden name=txtConfirmPswd value = "<%=server.HTMLEncode(F_strConfirmPswd)%>" >
  236.         <input type=hidden name=hdnPswdChanged value = "<%=server.HTMLEncode(F_strPswdChanged)%>">
  237.         <input type=hidden name=hdnUserLocation value = "<%=server.HTMLEncode(F_strUserLocation)%>">
  238.     <%
  239.     End Function
  240.     
  241.     
  242.     'set form variables to be input for post back function    
  243.     Function SetGenFormVariables()
  244.  
  245.         F_strSiteID =  Request.Form("txtSiteID")
  246.         F_strDir = Request.Form("txtDir")
  247.         F_strAdminName = Request.Form("txtSiteAdmin")
  248.         F_strAdminPswd = Request.Form("txtAdminPwd")
  249.         F_strConfirmPswd = Request.Form("txtConfirmPswd")
  250.         F_strPswdChanged = Request.Form("hdnPswdChanged")
  251.         F_strUserLocation = Request.Form("hdnUserLocation")
  252.     End Function
  253.     
  254.     
  255.     '----------------------------------------------------------
  256.     'Site identites Property page
  257.     '----------------------------------------------------------        
  258.     '-------------------------------------------------------------------------
  259.     ' Start of declaring form variables
  260.     '-------------------------------------------------------------------------
  261.     
  262.     Dim F_strIPAddr            'holds IPAddress value
  263.     Dim F_strPort            'holds port value
  264.     Dim F_strHeader            'holds Site header value    
  265.     
  266.     '-------------------------------------------------------------------------
  267.     ' End of declaring form variables
  268.     '-------------------------------------------------------------------------
  269.     
  270.     %>
  271.     
  272.     <script language="Javascript" >
  273.         
  274.         function SiteInit()
  275.         {
  276.             //do all the init                
  277.         }
  278.         
  279.         function SiteValidatePage()
  280.         {
  281.              //do all the validation
  282.              if(document.frmTask.txtPort.value == 0)
  283.              {
  284.                  document.frmTask.txtPort.value = "";                 
  285.                  DisplayErr("<%= Server.HTMLEncode(L_VALID_PORT_ERRORMESSAGE) %>");
  286.                  document.frmTask.txtPort.focus();
  287.                  return false;
  288.              }
  289.  
  290.             return true;
  291.         }
  292.         
  293.         function SiteSetData()
  294.         {
  295.         }
  296.         
  297.     </script>    
  298.     
  299.     <%    
  300.     
  301.     
  302.     '-------------------------------------------------------------------------
  303.     'Function name        :SiteIdentitiesViewTab
  304.     'Description        :Serves in getting the Site Identities properties page
  305.     'Input Variables    :None
  306.     'Output Variables    :None
  307.     'Returns            :(True / Flase )
  308.     'Global Variables    :None
  309.     '                in    :L_*            
  310.     '--------------------------------------------------------------------------    
  311.     Function SiteIdentitiesViewTab()
  312.  
  313.         Dim objService                'holds WMI Connection object
  314.         Dim ObjIPCollection            'holds IPCollection object    
  315.         Dim instIPAddr                'holds instance of IPAddress
  316.         Dim IPCount                    'holds instance of IP count
  317.  
  318.         Set objService =getWMIConnection(CONST_WMI_WIN32_NAMESPACE)
  319.         Set objIPCollection = objService.execquery("select * from Win32_NetworkAdapterConfiguration where IPEnabled=true")
  320.     %>
  321.  
  322.     <TABLE WIDTH=518 VALIGN=middle ALIGN=left BORDER=0 CELLSPACING=0 CELLPADDING=2 class="TasksBody" >
  323.         <TR>
  324.             <TD class="TasksBody" >
  325.                 <%=L_SITE_IPADDR_TEXT%>
  326.             </TD>
  327.             <TD class="TasksBody" >
  328.                 <select class="formField" NAME="cboIPAddr"  MAXLENGTH="80" SIZE="1"  value="<%=server.HTMLEncode(F_strIPAddr)%>">
  329.                     <option value=""><%=L_IP_UNASSIGNED_TEXT%></option>
  330.                     <%if server.HTMLEncode(F_strIPAddr)<>"" then %>
  331.                         <option value="<%=server.HTMLEncode(F_strIPAddr)%>" selected><%=server.HTMLEncode(F_strIPAddr) %></option>
  332.                     <%end if%>
  333.                     <% for each instIPAddr in  objIPCollection
  334.                             for IPCount =0 to ubound(instIPAddr.IPAddress)
  335.                             if instIPAddr.IPAddress(IPCount)<> server.HTMLEncode(F_strIPAddr) then %>
  336.                                 <option value="<%=instIPAddr.IPAddress(IPCount)%>"><%=instIPAddr.IPAddress(IPCount) %></option>
  337.                             <%end if
  338.                               Next 
  339.                         Next 
  340.                         set ObjIPCollection =  nothing
  341.                         set objService = nothing
  342.                     %>
  343.                 </select>
  344.             </TD>
  345.         </TR>
  346.         <TR>
  347.             <TD class="TasksBody" >
  348.                 <%=L_SITE_TCPPORT_TEXT%>
  349.             </TD>
  350.             <TD class="TasksBody" >
  351.             <%if server.HTMLEncode(F_strPort)<>"" then%>
  352.                 <input type=text class="formField" NAME="txtPort"  SIZE="10"  value="<%=server.HTMLEncode(F_strPort)%>"  OnKeyUP="checkUserLimit(this,'port')" OnKeypress="checkkeyforNumbers(this)" OnBlur= "checkfordefPortValue(this);">  
  353.             <%else%>
  354.                 <input type=text class="formField" NAME="txtPort"  SIZE="10"  value="80"  OnKeyUP="checkUserLimit(this,'port')" OnKeypress="checkkeyforNumbers(this)" OnBlur= "checkfordefPortValue(this);">  
  355.             <%end if%>
  356.             </TD>
  357.         </TR>
  358.         <TR>
  359.             <TD class="TasksBody" >
  360.                 <%=L_SITE_HOST_HEADER_TEXT%>
  361.             </TD>
  362.             <TD class="TasksBody" >
  363.                 <input type=text class="formField" NAME="txtHeader" MAXLENGTH="256" SIZE="40"   value="<%=server.HTMLEncode(F_strHeader)%>" OnKeypress="headerscheckKeyforCharacters(this)">
  364.             </TD>
  365.         </TR>        
  366.     </TABLE>
  367.     
  368.     <%
  369.     
  370.     End Function
  371.     
  372.     '------------------------------------------------------------------------------------------
  373.     'Function name        :SiteIdentitiesHiddenTab
  374.     'Description        :Serves in setting the hidden fields in Site Identities properties page
  375.     'Input Variables    :None
  376.     'Output Variables    :None
  377.     'Returns            :(True / Flase )
  378.     'Global Variables    :None
  379.     '                in    :L_*            
  380.     '-----------------------------------------------------------------------------------------
  381.     
  382.     Function SiteIdentitiesHiddenTab()
  383.     %>        
  384.         <input type=hidden name=cboIPAddr value = "<%=server.HTMLEncode(F_strIPAddr)%>" >
  385.         <input type=hidden name=txtPort value = "<%=server.HTMLEncode(F_strPort)%>" >
  386.         <input type=hidden name=txtHeader value = "<%=server.HTMLEncode(F_strHeader)%>" >    
  387.  
  388.     <%
  389.     End function
  390.     
  391.     
  392.     Function SetSiteIdentitiesFormVariables()
  393.                 
  394.         F_strIPAddr = Request.Form("cboIPAddr")
  395.         F_strPort = Request.Form("txtPort")
  396.         F_strHeader = Request.Form("txtHeader")    
  397.     
  398.     End Function
  399.     
  400.     
  401.     '-------------------------------------------------------------------------
  402.     ' Start of declaring form variables
  403.     '-------------------------------------------------------------------------
  404.     Dim F_selectActiveFormat
  405.     Dim F_selectDefaultPage
  406.     Dim F_strchkAllow
  407.     Dim F_strDefaultPageText    
  408.     Dim    F_strUploadMethod            'holds value to upload content method (neither, FTP, or FPSE)
  409.     
  410.     '-------------------------------------------------------------------------
  411.     ' End of declaring form variables
  412.     '-------------------------------------------------------------------------
  413.     %>
  414.     <script language="Javascript" >
  415.         function ApplInit()
  416.         {
  417.             SetButtonSelectedState();
  418.         }        
  419.  
  420.         function OnPageItemSelected()
  421.         {
  422.             SetButtonSelectedState();
  423.         }
  424.         
  425.         function SetButtonSelectedState()
  426.         {
  427.             var bSelect;
  428.             var index = document.frmTask.selectDefaultPage.selectedIndex;
  429.             //
  430.             // Was an item selected?
  431.             if( index < 0) 
  432.             {
  433.                 bSelect = false;
  434.             }
  435.             else
  436.             {
  437.                 bSelect = true;
  438.             }
  439.             
  440.             var oMoveUp = document.getElementById("btnMoveUp");
  441.             if ( oMoveUp != null ) {
  442.                 SA_EnableButton(oMoveUp, bSelect);
  443.             }
  444.             var oMoveDown = document.getElementById("btnMoveDown");
  445.             if ( oMoveDown != null ) {
  446.                 SA_EnableButton(oMoveDown, bSelect);
  447.             }
  448.             var oRemove = document.getElementById("btnRemove");
  449.             if ( oRemove != null ) {
  450.                 SA_EnableButton(oRemove, bSelect);
  451.             }        
  452.         }        
  453.         
  454.         function ApplValidatePage()
  455.         {
  456.             //do all the validation    
  457.             document.frmTask.hdnchkAllow.value = 
  458.                         document.frmTask.chkAllow.checked;
  459.             return true;
  460.         }
  461.         function ApplSetData()
  462.         {
  463.             var i;
  464.             var strText;
  465.             
  466.             strText ="";
  467.             for(i=0;i < document.frmTask.selectDefaultPage.length;i++)
  468.             {
  469.                 strText = strText+document.frmTask.selectDefaultPage.options[i].
  470.                         text+",";
  471.             }
  472.             
  473.             strText = strText.substr(0,strText.length-1);
  474.             
  475.             document.frmTask.DefaultPageText.value =strText;
  476.                     
  477.             //Get the method for uploading content
  478.             for(i=0;i<3;i++)
  479.             {
  480.                 if(document.frmTask.radUploadMethod[i].checked == true)
  481.                 {
  482.                     document.frmTask.hdnUploadMethod.value = 
  483.                         document.frmTask.radUploadMethod[i].value;
  484.                 }
  485.             }
  486.  
  487.         }
  488.         
  489.         function ClickAdd()
  490.         {
  491.             var i;
  492.             var oOption;
  493.             var filename;
  494.             
  495.             filename = RTrimtext(LTrimtext(document.frmTask.txtFileName.value));        
  496.             if(document.frmTask.txtFileName.value == ""||
  497.                 IsAllSpaces(filename))
  498.             {
  499.                 document.frmTask.txtFileName.select();
  500.                 DisplayErr("<%=Server.HTMLEncode(L_ERR_INPUT_ISEMPTY)%>");
  501.                 return;
  502.             }
  503.             
  504.             //add the file to the top of select
  505.             if(document.frmTask.selectDefaultPage.length==12)
  506.             {
  507.                 DisplayErr("<%=Server.HTMLEncode(L_ERR_EXCEED_TWELVE)%>");
  508.                 return;
  509.             }
  510.             //check wheather the file in list
  511.             for(i=0; i < document.frmTask.selectDefaultPage.length;i++)
  512.             {
  513.                 if(document.frmTask.selectDefaultPage.options[i].text==filename)
  514.                 {
  515.                     document.frmTask.txtFileName.select();
  516.                     document.frmTask.txtFileName.focus();
  517.                     DisplayErr("<%=Server.HTMLEncode(L_ERR_FILE_EXIST)%>");
  518.                     return;
  519.                 }
  520.             }            
  521.             
  522.             //modify the value of the old option items
  523.             var len=document.frmTask.selectDefaultPage.length;
  524.             document.frmTask.selectDefaultPage.options[len]=
  525.                 new Option("",len.toString());
  526.             for(i=len;i>0;i--)
  527.                 document.frmTask.selectDefaultPage.options[i].text=
  528.                     document.frmTask.selectDefaultPage.options[i-1].text;
  529.             document.frmTask.selectDefaultPage.options[0].text=filename;
  530.             document.frmTask.selectDefaultPage.options[0].selected = true;            
  531.  
  532.             document.frmTask.txtFileName.value="";
  533.             document.frmTask.txtFileName.focus();
  534.         }
  535.         
  536.         function ClickMoveUp()
  537.         {
  538.             var index;
  539.             var text;
  540.             
  541.             index = document.frmTask.selectDefaultPage.selectedIndex;
  542.             //
  543.             // Was an item selected?
  544.             if( index < 0) return;
  545.  
  546.             //
  547.             // Can not move-up the first item
  548.             if( index == 0) return;
  549.  
  550.             
  551.             text = document.frmTask.selectDefaultPage.options[index-1].text;
  552.             document.frmTask.selectDefaultPage.options[index-1].text=
  553.             document.frmTask.selectDefaultPage.options[index].text;
  554.             document.frmTask.selectDefaultPage.options[index].text=text;
  555.             
  556.             document.frmTask.selectDefaultPage.selectedIndex = index-1;
  557.  
  558.         }
  559.         
  560.         function ClickMoveDown()
  561.         {
  562.             var index;
  563.             var text;
  564.             
  565.             if(document.frmTask.selectDefaultPage.length==0)
  566.                 return;
  567.             
  568.             index = document.frmTask.selectDefaultPage.selectedIndex;
  569.             //
  570.             // Was an item selected?
  571.             if( index < 0) return;
  572.                         
  573.             if( index == document.frmTask.selectDefaultPage.length-1)
  574.                 return;
  575.             
  576.             text = document.frmTask.selectDefaultPage.options[index].text;
  577.             document.frmTask.selectDefaultPage.options[index].text=
  578.                     document.frmTask.selectDefaultPage.options[index+1].text;
  579.             document.frmTask.selectDefaultPage.options[index+1].text=text;
  580.             document.frmTask.selectDefaultPage.selectedIndex = index+1;
  581.         }
  582.         function ClickRemove()
  583.         {
  584.             var index;
  585.             
  586.             if(document.frmTask.selectDefaultPage.length == 0)
  587.                 return;
  588.             index = document.frmTask.selectDefaultPage.selectedIndex;
  589.             //
  590.             // Was an item selected?
  591.             if( index < 0) return;
  592.             
  593.             document.frmTask.selectDefaultPage.remove(index);
  594.             
  595.             if(index == document.frmTask.selectDefaultPage.length)
  596.                 document.frmTask.selectDefaultPage.selectedIndex=index-1;
  597.             else
  598.                 document.frmTask.selectDefaultPage.selectedIndex =index;
  599.             SetButtonSelectedState();
  600.         }        
  601.     </script>
  602. <%
  603.     '------------------------------------------------------------------------
  604.     'Application settings Property page
  605.     '------------------------------------------------------------------------
  606.     '-------------------------------------------------------------------------
  607.     'Function name        :ApplicationSettingsViewTab
  608.     'Description        :Serves in getting the Site application settings page
  609.     'Input Variables    :None
  610.     'Output Variables    :None
  611.     'Returns            :(True / Flase )
  612.     'Global Variables    :None
  613.     '--------------------------------------------------------------------------
  614.     
  615.     Function ApplicationSettingsViewTab()
  616.     
  617.         Dim objService        'holds WMI Connection object
  618.         Dim FrontIsInstalled
  619.  
  620.                         
  621.         Err.Clear
  622.         on error resume next        
  623.         
  624.         Set objService = getWMIConnection(CONST_WMI_IIS_NAMESPACE)
  625.  
  626.         'Determine default execute permissions        
  627.         Dim objSetting        'holds Webservicesetting connection        
  628.         Dim inst            'holds instance object
  629.         
  630.         if F_selectActiveFormat = "" then
  631.         
  632.             Set objSetting =objService.Get(GetIISWMIProviderClassName("IIs_WebServiceSetting") & ".Name='W3SVC'")
  633.             if objSetting.Name = "W3SVC" then    
  634.                 if objSetting.AccessExecute = TRUE and objSetting.AccessScript = TRUE then
  635.                     F_selectActiveFormat = 2
  636.                 elseif objSetting.AccessExecute = false and objSetting.AccessScript = TRUE then
  637.                     F_selectActiveFormat = 1
  638.                 elseif objSetting.AccessExecute = false and objSetting.AccessScript = false then
  639.                     F_selectActiveFormat =0
  640.                 elseif isnull(objSetting.AccessExecute) and isnull(objSetting.AccessScript) then
  641.                     F_selectActiveFormat = 0
  642.                 end if
  643.             end    if
  644.             
  645.         end if
  646.         
  647.         'Release the objects
  648.  
  649.         set objSetting = nothing    
  650.         set objService = nothing 
  651.     
  652.     %>
  653.     
  654.     <TABLE WIDTH=400 VALIGN=middle ALIGN=left BORDER=0 CELLSPACING=0 CELLPADDING=0 class="TasksBody">
  655.         <TR>
  656.             <TD class="TasksBody"  nowrap> 
  657.                 <%= L_EXECUTE_PERMISSIONS %>
  658.             </TD>
  659.             <TD class="TasksBody" >
  660.                 <SELECT class="formField" name="selectActiveFormat" MAXLENGTH="80" size="1" value="<%=server.HTMLEncode(F_selectActiveFormat)%>">
  661.                 <%    
  662.                     if server.HTMLEncode(F_selectActiveFormat)="0" then %>                    
  663.                         <OPTION value="0" selected><%= L_NONE %></OPTION>
  664.                         <OPTION value="1"><%= L_SCRIPTS_ONLY %></OPTION>
  665.                         <OPTION value="2"><%= L_SCRIPTS_EXECUTABLES %></OPTION>                        
  666.                     <%elseif server.HTMLEncode(F_selectActiveFormat)="1" then  %>
  667.                         
  668.                         <OPTION value="0"><%= L_NONE %></OPTION>
  669.                         <OPTION value="1" selected><%= L_SCRIPTS_ONLY %></OPTION>
  670.                         <OPTION value="2"><%= L_SCRIPTS_EXECUTABLES %></OPTION>                        
  671.                         
  672.                     <%elseif server.HTMLEncode(F_selectActiveFormat)="2" then  %>
  673.                         <OPTION value="0"><%= L_NONE %></OPTION>
  674.                         <OPTION value="1"><%= L_SCRIPTS_ONLY %></OPTION>
  675.                         <OPTION value="2" selected><%= L_SCRIPTS_EXECUTABLES %></OPTION>
  676.                     <% end if %>
  677.                 </SELECT>
  678.             </TD>            
  679.         </TR>
  680.         <TR><TD class="TasksBody" colspan = 3 > </TD></TR>
  681.         <TR><TD class="TasksBody" colspan=3 nowrap ><%=L_DEFAULT_PAGE%></TD></TR>
  682.         <TR>
  683.             <TD class="TasksBody" rowspan=5 align="right">
  684.                 <SELECT class="formField" name="selectDefaultPage" MAXLENGTH="12" size="6" style="WIDTH: 100px" onclick='OnPageItemSelected();' >
  685.                     <%=DisplayDefaultPageItems()%>
  686.                 </SELECT>
  687.             </TD>
  688.         </TR>
  689.         <TR>
  690.             <TD class="TasksBody" colspan = 2 nowrap>
  691.                     
  692.                 <%Call SA_ServeOnClickButtonEx(L_BUTTON_FACE_ADD, "", "ClickAdd();", 65, 0, "","btnAdd")%>
  693.                 <%=L_FILE_NAME%>  
  694.                 <input type=text class="formField" 
  695.                     NAME="txtFileName"  
  696.                     style = "width:100"
  697.                     value=""
  698.                     onkeydown="ClearErr();">
  699.             </TD>
  700.         </TR>
  701.         <TR>
  702.             <TD class="TasksBody" colspan = 2 >
  703.                     
  704.                 <%Call SA_ServeOnClickButtonEx(L_BUTTON_FACE_MOVE_UP, "", "ClickMoveUp();", 65, 0, "disabled","btnMoveUp")%>
  705.             </TD>
  706.         </TR>
  707.         <TR>
  708.             <TD class="TasksBody" colspan = 2 >
  709.                     
  710.                 <%Call SA_ServeOnClickButtonEx(L_BUTTON_FACE_MOVE_DOWM, "", "ClickMoveDown();", 65, 0, "disabled","btnMoveDown")%>
  711.             </TD>
  712.         </TR>
  713.         <TR>
  714.             <TD class="TasksBody" colspan = 2 >
  715.                     
  716.                 <%Call SA_ServeOnClickButtonEx(L_BUTTON_FACE_REMOVE, "", "ClickRemove();", 65, 0, "disabled","btnRemove")%>
  717.             </TD>
  718.         </TR>        
  719.         <TR><TD  class="TasksBody" colspan = 2> </TD></TR>
  720.         <TR>
  721.             <TD colspan="2">
  722.                 <%Call ServeAppSettings(F_strDir, F_strUploadMethod, F_strchkAllow, False)%>
  723.             </TD>
  724.         </TR>
  725.     </TABLE>
  726.     <input type=hidden name=DefaultPageText value = "<%=server.HTMLEncode(F_strDefaultPageText)%>">
  727.     <input type=hidden name=hdnchkAllow value = "<%=server.HTMLEncode(F_strchkAllow)%>">
  728.     <input type=hidden name=hdnUploadMethod value = "<%=server.HTMLEncode(F_strUploadMethod)%>" >        
  729.  
  730.     <%
  731.     
  732.     End Function
  733.     
  734.     '-------------------------------------------------------------------------
  735.     'Function name        :ApplicationSettingsHiddenTab
  736.     'Description        :Serves in storing hidden values
  737.     'Input Variables    :None
  738.     'Output Variables    :None
  739.     'Returns            :(True / Flase )
  740.     'Global Variables    :None
  741.     '--------------------------------------------------------------------------
  742.     Function ApplicationSettingsHiddenTab()
  743.     
  744.     %>        
  745.         <input type=hidden name=hdnchkAllow value = "<%=server.HTMLEncode(F_strchkAllow)%>">        
  746.         <input type=hidden name=selectActiveFormat value="<%=server.HTMLEncode(F_selectActiveFormat)%>">
  747.         <input type=hidden name=selectDefaultPage value = "<%=server.HTMLEncode(F_selectDefaultPage)%>">
  748.         <input type=hidden name=DefaultPageText value = "<%=server.HTMLEncode(F_strDefaultPageText)%>">
  749.         <input type=hidden name=hdnUploadMethod value = "<%=server.HTMLEncode(F_strUploadMethod)%>" >
  750.     <%
  751.     
  752.     End Function
  753.     
  754.     'set form variables to be input for post back function
  755.     Function SetApplnSettingsFormVariables()
  756.         F_strchkAllow = Request.Form("hdnchkAllow")        
  757.         F_selectActiveFormat = Request.Form("selectActiveFormat")
  758.         F_selectDefaultPage = Request.Form("selectDefaultPage")
  759.         F_strDefaultPageText = Request.Form("DefaultPageText")
  760.         F_strUploadMethod = Request.Form("hdnUploadMethod")        
  761.     End Function
  762.     
  763.     Function DisplayDefaultPageItems()
  764.         On Error Resume Next
  765.         Err.Clear
  766.         
  767.         Dim i
  768.         Dim arrItems
  769.         arrItems = split(F_strDefaultPageText,",")
  770.         
  771.         For i=0 to ubound(arrItems)
  772.             If (F_selectDefaultPage = CStr(i)) then
  773.                 Response.Write("<OPTION value="&chr(34)&CStr(i)&chr(34)&" selected>"&arrItems(i)&"</OPTION>")
  774.             Else
  775.                 Response.Write("<OPTION value="&chr(34)&CStr(i)&chr(34)&">"&arrItems(i)&"</OPTION>")
  776.             End If
  777.         Next        
  778.     End Function
  779. %>
  780.